<?php
class CaseModel extends Model{
	//获取全部图书
	public function getCases($offset,$pagesize){
		//$sql="select * from {$this->table} limit {$offset},{$pagesize}";
		$sql="SELECT tb_bookcase.*,b.num FROM {$this->table} 
			LEFT JOIN (SELECT COUNT(*) AS num,bookcase FROM tb_bookinfo GROUP BY bookcase) as b 
			ON b.bookcase=tb_bookcase.id order by id desc limit {$offset},{$pagesize}";
		return $this->db->getAll($sql);
	}
}